﻿using OnDash.Windowing.GraphicsLibraryFramework;
using JoystickCallback = OnDash.Windowing.GraphicsLibraryFramework.GlfwCallbacks.JoystickCallback;

namespace OnDash.Windowing.Desktop;

public struct Joysticks
{
    public static event JoystickCallback? JoystickCallback;

    private static readonly JoystickCallback _joystickCallback;

    static Joysticks()
    {
        GlfwProvider.EnsureInitialized();
        _joystickCallback = (id, state) => JoystickCallback!(id, state);
        Glfw.SetJoystickCallback(_joystickCallback);
    }
}